<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Keu_posting extends MY_Controller {
	
	function __construct()
	{
		parent::__construct(); 
		
		$this->load->model('keu_posting_model', 'GLPosting');
		$this->load->model('keu_transaksi_detail_model', 'GLPostingDetail');		
		$this->load->model('keu_store_procedure_model', 'SP');
		$this->secure_session();
	}
	
	function index(){
		$data['title'] = "GL Posting";
		$data['data'] = null;
		$data['data']['date_from'] = date('01/m/Y');
		$data['data']['date_to'] = date('t/m/Y');
		viewByTemplate('keu_posting/index', $data, 'grid');
	}
	
	function getdata()
	{
		$this->secure_session();
		echo $this->GLPosting->GetJSON();
	}
	
	function dtl_account_data()
	{
		echo $this->GLPostingDetail->GetJSON();
	}
	
	function posting()
	{	
		$this->SP->SP_GL_POSTING(date('Y'));
		
		$arr_response = array("is_error"=> '0', "msg"=>'Proses posting berhasil.');
		echo json_encode($arr_response);
	}
	
	
	
}
?>